package com.jw.debezuim.config.context;

import com.alibaba.ttl.TransmittableThreadLocal;

import java.util.HashMap;
import java.util.Map;

/**
 **/
abstract class AbsTC {

    private static final ThreadLocal<Map<String,Object>> TTL = new TransmittableThreadLocal();

    protected static Map<String, Object> getMap() {
        Map<String, Object> map = TTL.get();
        if (map == null) {
            map = new HashMap<>();
            TTL.set(map);
        }
        return map;
    }

    public static void remove() {
        TTL.remove();
    }

}
